﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif 

// **********************************************************************
// Copyright (C) XM
// Author: 赵思佳
// Date: 2019-01-16
// Desc: 
// **********************************************************************
namespace SpaceDFramework
{
    public class TransformSimplify
    {
        public static void SetLocalTransformX(ref Transform localTrans, float x)
        {
            Vector3 localPos = localTrans.localPosition;
            localPos.x = x;
            localTrans.localPosition = localPos;
        }
        public static void SetLocalTransformY(ref Transform localTrans, float y)
        {
            Vector3 localPos = localTrans.localPosition;
            localPos.y = y;
            localTrans.localPosition = localPos;
        }
        public static void SetLocalTransformZ(ref Transform localTrans, float z)
        {
            Vector3 localPos = localTrans.localPosition;
            localPos.z = z;
            localTrans.localPosition = localPos;
        }

        public static void Identity(Transform localTrans)
        {
            localTrans.localPosition = Vector3.zero;
            localTrans.localRotation = Quaternion.identity;
            localTrans.localScale = Vector3.one;
            CommonUtil.Log("初始化完毕");
        }
    }
}
